<script>
//混合图表配置
import BaseConfig from '../BaseConfig';
import * as ConfigEnum from '../config/config-enum';
import * as utils from '../../../../utils/helps';

export default {
  name: 'MixinChartConfig',
  mixins: [BaseConfig],
  data() {
    return {
      selectedMetrics: [], //显示指标
    };
  },
  created() {
    this.selectedMetrics = this.chartOptions.settings.showLine;
  },
  methods: {
    //更新混合折线配置
    updateMixinLineConfig() {
      this.chartOptions.settings.showLine = utils.deepCopy(this.selectedMetrics);
      this.updateOptions();
    },
  },
};
</script>

<template>
  <div>
    <Row>
      <Col span="8">
      <span>折线显示指标：</span>
      </Col>
      <Col span="16">
      <Select
        v-model="selectedMetrics"
        multiple
        @on-change="updateMixinLineConfig">
        <Option
          v-for="item in chartOptions.settings.metrics"
          :value="item"
          :key="item"
        >{{ item }}</Option>
      </Select>
      </Col>
    </Row>
  </div>
</template>

<style>
</style>
